package com.advertise.strutsAction;

import com.advertise.model.SystemConfig;
import com.advertise.service.SystemConfigService_IFace;
import com.opensymphony.xwork2.ActionSupport;

public class SystemConfigPageAction {
	
	private SystemConfigService_IFace systemConfigService ;
	
	
	
	public SystemConfigService_IFace getSystemConfigService() {
		return systemConfigService;
	}



	public void setSystemConfigService(SystemConfigService_IFace systemConfigService) {
		this.systemConfigService = systemConfigService;
	}


	private SystemConfig config;
	

	public SystemConfig getConfig() {
		return config;
	}



	public void setConfig(SystemConfig config) {
		this.config = config;
	}



	public String initPage(){
		config = systemConfigService.getbyID(1);
		
		return ActionSupport.SUCCESS;
	}
	
	public String saveConfig(){
		
		systemConfigService.save(config);
		return ActionSupport.SUCCESS;
	}
}
